package operations;

import book.BookList;

import java.util.Scanner;

public class ReturnOperation implements IOperation{
    @Override
    public void work(BookList books) {
        System.out.println("请输入您要归还的图书书名");
        Scanner scanner=new Scanner(System.in);
        String name=scanner.nextLine();
        for (int i = 0; i < books.getUsedSize(); i++) {
            if(books.getbook(i).getName().equals(name)){
                books.getbook(i).setBorrowed(false);
                System.out.println("归还成功");
                return;
            }
        }
        System.out.println("未找到符合条件的图书");
    }
}
